#!/bin/bash

set -e

export SILVER_HOME=`pwd`
echo $SILVER_HOME

# No no, the user should do this.
#./update

# Do make sure any compiler changes make it before we build do
./self-compile
cp build/silver.composed.Default.jar jars/

# Rebuild the IDE-specific runtime jars
cd runtime/imp
./build.sh
cd ../..

# Create plug-in sources and .class files.
# this creates a silver.composed.idetest.jar that is not used, but
# this does create stuff in the generated directory that is used in
# the next step
./self-compile-ide

# Create the Eclipse repository.  
# The repository is in the generated/ide/silver.composed.idetest
# directory.  To make it public run the make-ide-dist script.
cd generated/ide/silver.composed.idetest
mvn package

TARGET=`pwd`/updatesite/target/repository

echo "..."
echo "..."
echo "..."
echo "Be sure to increment IDE version number in silver:composed:idetest:Main.sv"
echo "..."
echo "..."
echo "Reminder: add $TARGET as path to find update site in eclipse, if using directly"
echo "..."
